#include <iostream>
using namespace std;
char exchange (char c[],int x);
int main ()
{char a[80];
 while(1)
 {gets(a);
  if(a[80]=='#')  break;
  for(int i=0;i<80;i++)
  {a[i]=exchange(a,i);
  }
  cout<<a<<endl;
 }
 system("pause");
 return 0;
}


char exchange(char c[],int x)
{if(c[x]==' ')   return '%20';
 if(c[x]=='!')   return '%21';
 if(c[x]=='$')   return '%24';
 if(c[x]=='%')   return '%25';
 if(c[x]=='(')   return '%28';
 if(c[x]==')')   return '%29';
 if(c[x]=='*')   return '%2a';
} 


 
  
